home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / src / pager.h < prev    next >
C/C++ Source or Header  |  1996-05-15  |  2KB  |  126 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #if !defined (octave_pager_h)
  24. #define octave_pager_h 1
  25.  
  26. #include <string>
  27.  
  28. #include <iostream.h>
  29. #include <strstream.h>
  30.  
  31. #ifdef HAVE_SYS_TYPES_H
  32. #include <sys/types.h>
  33. #endif
  34.  
  35. class
  36. octave_pager_buf : public strstreambuf
  37. {
  38. public:
  39.  
  40.   octave_pager_buf (int size = 0) : strstreambuf (size) { }
  41.  
  42. protected:
  43.  
  44.   int sync (void);
  45. };
  46.  
  47. class
  48. octave_pager_stream : public ostream
  49. {
  50. protected:
  51.  
  52.   octave_pager_stream (void);
  53.  
  54. public:
  55.  
  56.   ~octave_pager_stream (void);
  57.  
  58.   static octave_pager_stream& stream (void);
  59.  
  60. private:
  61.  
  62.   static octave_pager_stream *instance;
  63.  
  64.   octave_pager_buf *pb;
  65.  
  66.   // No copying!
  67.  
  68.   octave_pager_stream (const octave_pager_stream&);
  69.  
  70.   octave_pager_stream& operator = (const octave_pager_stream&);
  71. };
  72.  
  73. class
  74. octave_diary_buf : public strstreambuf
  75. {
  76. public:
  77.  
  78.   octave_diary_buf (int size = 0) : strstreambuf (size) { }
  79.  
  80. protected:
  81.  
  82.   int sync (void);
  83. };
  84.  
  85. class
  86. octave_diary_stream : public ostream
  87. {
  88. protected:
  89.  
  90.   octave_diary_stream (void);
  91.  
  92. public:
  93.  
  94.   ~octave_diary_stream (void);
  95.  
  96.   static octave_diary_stream& stream (void);
  97.  
  98. private:
  99.  
  100.   static octave_diary_stream *instance;
  101.  
  102.   octave_diary_buf *db;
  103.  
  104.   // No copying!
  105.  
  106.   octave_diary_stream (const octave_diary_stream&);
  107.  
  108.   octave_diary_stream& operator = (const octave_diary_stream&);
  109. };
  110.  
  111. #define octave_stdout (octave_pager_stream::stream ())
  112.  
  113. #define octave_diary (octave_diary_stream::stream ())
  114.  
  115. extern void flush_octave_stdout (void);
  116.  
  117. extern void symbols_of_pager (void);
  118.  
  119. #endif
  120.  
  121. /*
  122. ;;; Local Variables: ***
  123. ;;; mode: C++ ***
  124. ;;; End: ***
  125. */
  126.